package com.liao.badminton.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.liao.badminton.code.*;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.liao.badminton.dto.BadmintonGroupDto;
import com.liao.badminton.vo.BadmintonGroupVo;
import org.apache.ibatis.annotations.Mapper;
import com.liao.badminton.entity.BadmintonGroup;
import org.apache.ibatis.annotations.Param;
import java.util.List;

/**
* @author liaocheng
* @date 2024-10-31
* description:群表
*/
@Mapper
public interface BadmintonGroupMapper extends BaseMapper<BadmintonGroup> {
    int updateBy(BadmintonGroup badmintonGroup);
    int add(BadmintonGroup badmintonGroup);
    List<BadmintonGroup> findByPageParam(PageParam<BadmintonGroup> badmintonGroupPageParam);
    int countByPageParam(PageParam<BadmintonGroup> badmintonGroupPageParam);
    int deletes(@Param("ids") List<Long> ids);
    List<BadmintonGroup> findByIds(@Param("ids") List<Long> ids);
    void addBatch(List<BadmintonGroup> list);
    BadmintonGroup findById(@Param("id") Long id);
    List<BadmintonGroup> findByParam(@Param("param") BadmintonGroup param);

    void updateCompetitionNum(@Param("groupId") Long groupId, @Param("num") Integer num);

    void updateActiveNum(@Param("groupId") Long groupId, @Param("num") Integer num);
    List<BadmintonGroupVo> getListByUserId(PageParam<BadmintonGroupDto> pageParam);

    List<BadmintonGroupVo> findGroupByUserId(Long userId);

}
